﻿import router from '/@/router';

import request from '/@/utils/request';
enum Api {
  AddPayFess = '/api/payFess/add',
  DeletePayFess = '/api/payFess/delete',
  UpdatePayFess = '/api/payFess/update',
  PagePayFess = '/api/payFess/page',
  DetailPayFess = '/api/payFess/detail',
  EnumPayItemBills = '/api/payFess/payEnums/1',
  EnumPaymentmethod = '/api/payFess/payEnums/2',
  ExcelExports = '/api/payFess/excel',
  EnumPayBilStatus = '/api/payFess/payEnums/3',
  PageOrderPayFess = '/api/payFess/orderPage',
  HouseList = '/api/payFess/getHouse',
  OrderExcelExports = '/api/payFess/orderExcel',
  GetpayDetails = '/api/payFess/orderPayById',
}

// 增加缴费
export const addPayFess = (params?: any) =>
	request({
		url: Api.AddPayFess,
		method: 'post',
		data: params,
	});

// 删除缴费
export const deletePayFess = (params?: any) => 
	request({
			url: Api.DeletePayFess,
			method: 'post',
			data: params,
		});

// 编辑缴费
export const updatePayFess = (params?: any) => 
	request({
			url: Api.UpdatePayFess,
			method: 'post',
			data: params,
		});

// 分页查询缴费
export const pagePayFess = (params?: any) => 
	request({
			url: Api.PagePayFess,
			method: 'post',
			data: params,
		});

// 详情缴费
export const detailPayFess = (id: any) => 
	request({
			url: Api.DetailPayFess,
			method: 'get',
			data: { id },
		});
// 账单类目枚举下拉框
export const enumPayItemBills = (sign:any)=>
	request({
		url:Api.EnumPayItemBills,
		method:'get',
		data:{sign}
	})
//支付方式枚举下拉框
export const enumPaymentmethod = (sign:any)=>
	request({
		url:Api.EnumPaymentmethod,
		method:'get',
		data:{sign}
	})
// 导出Excel
export const excelExports = () => 
	request({
			url: Api.ExcelExports,
			method: 'get',
			responseType: 'arraybuffer',
	});
//枚举账单状态下拉框
export const enumPayBilStatus = (sign:any)=>
	request({
		url:Api.EnumPayBilStatus,
		method:'get',
		data:{sign}
	})
//分页查询订单缴费
export const pageOrderPayFess = (params?: any) => 
	request({
			url: Api.PageOrderPayFess,
			method: 'post',
			data: params,
		});
//获取房屋列表
export const houseList = () => 
	request({
			url: Api.HouseList,
			method: 'get',
		});
//导出订单Excel
export const orderExcelExports = () => 
	request({
			url: Api.OrderExcelExports,
			method: 'get',
			responseType: 'arraybuffer',
	});
//获取订单缴费详情
export const getpayDetails = (pid: any) => 
	request({
			url: Api.GetpayDetails,
			method: 'get',
			data: { pid },
		});

